import 'dart:io';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'main_controller.dart';

class ThumbView extends StatelessWidget {
  const ThumbView({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    var c = Get.find<MainController>();
    return Container(
      width: double.infinity,
      padding: const EdgeInsets.all(5),
      // color: Colors.deepOrangeAccent,
      child: Obx(() {
        return c.thumbFile.value == "" ?
        const Icon(Icons.face_rounded, size: 100, color: Colors.grey) :
          Image.file(File(c.thumbFile.value),
            errorBuilder: (context, obj, err) => const Icon(Icons.warning_amber_outlined, size: 100, color: Colors.amber)
          );
      })
    );
  }
}

